﻿using System;
using Autofac;
using hello.csharp.helper.IoC;
using hello.csharp.logic.IoC;
using hello.csharp.storage.IoC;
using NLog;

namespace hello.csharp.kernel
{
    public class IoCManager
    {
        private readonly static ILogger _Logger = LogManager.GetCurrentClassLogger();

        #region Instance
        private static readonly IoCManager _Manager = new IoCManager();
        private IoCManager()
        {
        }
        public static IoCManager Instance => _Manager;
        #endregion

        public void Register(ContainerBuilder builder)
        {
            builder.RegisterModule<HelperModule>();
            builder.RegisterModule<LogicModule>();
            builder.RegisterModule<StorageModule>();
            _Logger.Info($"Autofac modle加载完成。");
        }
    }
}
